<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>收款方式 - USDTMarket</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        success: '#36D399',
                        danger: '#F87272',
                        dark: '#1E293B',
                        light: '#F1F5F9',
                        'dark-blue': '#0F172A',
                        'light-blue': '#E0E7FF',
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .glass {
                background: rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(10px);
                -webkit-backdrop-filter: blur(10px);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-3px);
                box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
            }
            .menu-item.active {
                border-left-color: theme('colors.primary');
                background-color: theme('colors.primary/10');
                color: theme('colors.light');
            }
            .payment-card.active {
                border-color: theme('colors.primary');
                background-color: theme('colors.primary/5');
            }
        }
    </style>
</head>
<body class="font-inter bg-gradient-to-br from-dark-blue to-dark min-h-screen text-light">
    <!-- 导航栏 -->
    <header class="fixed top-0 left-0 right-0 z-50 transition-all duration-300" id="navbar">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between glass border-b border-white/10">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                    <i class="fa fa-exchange text-white text-xl"></i>
                </div>
                <h1 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h1>
            </div>
            
            <nav class="hidden md:flex items-center space-x-8">
                <a href="#" class="text-white/70 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">购买USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">出售USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">交易记录</a>
                <a href="#" class="text-primary font-medium">收款方式</a>
            </nav>
            
            <div class="flex items-center space-x-4">
                <div class="relative">
                    <button class="flex items-center space-x-2 px-4 py-2 rounded-lg bg-primary/20 text-primary hover:bg-primary/30 transition-colors">
                        <i class="fa fa-user-circle-o text-xl"></i>
                        <span class="hidden md:inline">用户12345</span>
                        <i class="fa fa-angle-down"></i>
                    </button>
                </div>
                <button class="md:hidden text-white text-xl">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="container mx-auto px-4 pt-24 pb-16">
        <!-- 面包屑导航 -->
        <div class="mb-8 text-sm text-white/60">
            <a href="#" class="hover:text-primary transition-colors">首页</a> &gt; <span class="text-white">收款方式</span>
        </div>
        
        <div class="grid grid-cols-1 lg:grid-cols-4 gap-8">
            <!-- 侧边栏 -->
            <div class="lg:col-span-1">
                <div class="bg-dark-blue rounded-2xl p-6 border border-white/10 sticky top-24">
                    <div class="flex items-center space-x-4 mb-6">
                        <div class="w-16 h-16 rounded-full bg-primary/20 flex items-center justify-center text-primary">
                            <i class="fa fa-user-circle-o text-3xl"></i>
                        </div>
                        <div>
                            <h3 class="font-bold text-lg">用户12345</h3>
                            <p class="text-white/60 text-sm">普通用户</p>
                        </div>
                    </div>
                    
                    <div class="space-y-2">
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors">
                            <i class="fa fa-home w-5 text-center"></i>
                            <span>个人主页</span>
                        </a>
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors">
                            <i class="fa fa-money w-5 text-center"></i>
                            <span>我的钱包</span>
                        </a>
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors">
                            <i class="fa fa-exchange w-5 text-center"></i>
                            <span>交易记录</span>
                        </a>
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors active">
                            <i class="fa fa-credit-card w-5 text-center"></i>
                            <span>收款方式</span>
                        </a>
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors">
                            <i class="fa fa-shield w-5 text-center"></i>
                            <span>账户安全</span>
                        </a>
                        <a href="#" class="menu-item flex items-center space-x-3 px-4 py-3 rounded-lg border-l-4 border-transparent hover:bg-white/5 transition-colors">
                            <i class="fa fa-cog w-5 text-center"></i>
                            <span>账户设置</span>
                        </a>
                    </div>
                    
                    <div class="mt-8 pt-6 border-t border-white/10">
                        <button class="w-full px-4 py-3 bg-danger/20 text-danger rounded-lg hover:bg-danger/30 transition-colors flex items-center justify-center space-x-2">
                            <i class="fa fa-sign-out"></i>
                            <span>退出登录</span>
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- 主内容 -->
            <div class="lg:col-span-3">
                <!-- 收款方式列表 -->
                <div class="bg-dark-blue rounded-2xl p-6 border border-white/10 mb-8">
                    <div class="flex justify-between items-center mb-8">
                        <h2 class="text-xl font-bold">我的收款方式</h2>
                        <button id="add-payment-method" class="px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                            <i class="fa fa-plus mr-1"></i> 添加收款方式
                        </button>
                    </div>
                    
                    <!-- 已添加的收款方式 -->
                    <div class="space-y-4 mb-8">
                        <!-- 银行卡 -->
                        <div class="payment-card bg-dark rounded-xl p-6 border border-white/10 card-hover relative active">
                            <div class="absolute top-4 right-4 bg-primary/20 text-primary text-xs px-2 py-1 rounded-full">
                                默认
                            </div>
                            <div class="flex items-start">
                                <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mr-4">
                                    <i class="fa fa-credit-card text-xl"></i>
                                </div>
                                <div class="flex-1">
                                    <div class="flex justify-between items-start">
                                        <h3 class="text-lg font-bold mb-1">中国工商银行</h3>
                                        <div class="flex space-x-2">
                                            <button class="text-white/70 hover:text-primary transition-colors" onclick="editPaymentMethod('bank')">
                                                <i class="fa fa-pencil"></i>
                                            </button>
                                            <button class="text-white/70 hover:text-danger transition-colors" onclick="deletePaymentMethod('bank')">
                                                <i class="fa fa-trash"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <p class="text-white/70 mb-3">尾号 8888 · 张三</p>
                                    <div class="flex flex-wrap gap-2">
                                        <span class="px-2 py-1 bg-primary/10 text-primary rounded-full text-xs">出售USDT</span>
                                        <span class="px-2 py-1 bg-success/10 text-success rounded-full text-xs">提现</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 支付宝 -->
                        <div class="payment-card bg-dark rounded-xl p-6 border border-white/10 card-hover relative">
                            <div class="flex items-start">
                                <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mr-4">
                                    <i class="fa fa-credit-card text-xl"></i>
                                </div>
                                <div class="flex-1">
                                    <div class="flex justify-between items-start">
                                        <h3 class="text-lg font-bold mb-1">支付宝</h3>
                                        <div class="flex space-x-2">
                                            <button class="text-white/70 hover:text-primary transition-colors" onclick="editPaymentMethod('alipay')">
                                                <i class="fa fa-pencil"></i>
                                            </button>
                                            <button class="text-white/70 hover:text-danger transition-colors" onclick="deletePaymentMethod('alipay')">
                                                <i class="fa fa-trash"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <p class="text-white/70 mb-3">138****8888 · 张三</p>
                                    <div class="flex flex-wrap gap-2">
                                        <span class="px-2 py-1 bg-primary/10 text-primary rounded-full text-xs">出售USDT</span>
                                    </div>
                                    <button class="mt-3 text-sm text-primary hover:underline" onclick="setDefaultPayment('alipay')">
                                        设置为默认收款方式
                                    </button>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 微信 -->
                        <div class="payment-card bg-dark rounded-xl p-6 border border-white/10 card-hover relative">
                            <div class="flex items-start">
                                <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mr-4">
                                    <i class="fa fa-credit-card text-xl"></i>
                                </div>
                                <div class="flex-1">
                                    <div class="flex justify-between items-start">
                                        <h3 class="text-lg font-bold mb-1">微信支付</h3>
                                        <div class="flex space-x-2">
                                            <button class="text-white/70 hover:text-primary transition-colors" onclick="editPaymentMethod('wechat')">
                                                <i class="fa fa-pencil"></i>
                                            </button>
                                            <button class="text-white/70 hover:text-danger transition-colors" onclick="deletePaymentMethod('wechat')">
                                                <i class="fa fa-trash"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <p class="text-white/70 mb-3">微信昵称: 张三</p>
                                    <div class="flex flex-wrap gap-2">
                                        <span class="px-2 py-1 bg-primary/10 text-primary rounded-full text-xs">出售USDT</span>
                                    </div>
                                    <button class="mt-3 text-sm text-primary hover:underline" onclick="setDefaultPayment('wechat')">
                                        设置为默认收款方式
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="text-white/60 text-sm">
                        <p><i class="fa fa-info-circle text-primary mr-2"></i> 收款方式用于出售USDT时接收款项和提现到银行卡</p>
                        <p class="mt-2"><i class="fa fa-exclamation-circle text-danger mr-2"></i> 为了保障资金安全，收款账户必须与实名认证信息一致</p>
                    </div>
                </div>
                
                <!-- 收款方式使用说明 -->
                <div class="bg-dark-blue rounded-2xl p-6 border border-white/10">
                    <h3 class="text-lg font-bold mb-4">收款方式使用说明</h3>
                    <ul class="space-y-3 text-white/70">
                        <li class="flex items-start">
                            <i class="fa fa-check-circle text-success mt-1 mr-3"></i>
                            <span>添加的收款账户必须与您的实名认证信息一致，否则可能导致资金无法到账</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fa fa-check-circle text-success mt-1 mr-3"></i>
                            <span>您可以添加多种收款方式，在出售USDT时选择合适的收款方式</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fa fa-check-circle text-success mt-1 mr-3"></i>
                            <span>设置默认收款方式后，系统将自动选择该方式接收款项</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fa fa-check-circle text-success mt-1 mr-3"></i>
                            <span>如需要修改或删除收款方式，请确保没有进行中的交易使用该收款方式</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fa fa-check-circle text-success mt-1 mr-3"></i>
                            <span>如有任何疑问，请联系在线客服</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </main>

    <!-- 添加/编辑收款方式模态框 -->
    <div id="payment-modal" class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center hidden">
        <div class="bg-dark-blue rounded-2xl p-6 border border-white/10 w-full max-w-2xl mx-4 relative">
            <button id="close-modal" class="absolute top-4 right-4 text-white/70 hover:text-white">
                <i class="fa fa-times text-xl"></i>
            </button>
            
            <h3 class="text-xl font-bold mb-6" id="modal-title">添加收款方式</h3>
            
            <form id="payment-form">
                <!-- 支付方式选择 -->
                <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
                    <div class="payment-option bg-dark rounded-xl p-4 border border-white/10 cursor-pointer text-center hover:border-primary transition-colors active" data-type="bank">
                        <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mx-auto mb-3">
                            <i class="fa fa-university text-xl"></i>
                        </div>
                        <h4 class="font-medium">银行卡</h4>
                    </div>
                    
                    <div class="payment-option bg-dark rounded-xl p-4 border border-white/10 cursor-pointer text-center hover:border-primary transition-colors" data-type="alipay">
                        <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mx-auto mb-3">
                            <i class="fa fa-credit-card text-xl"></i>
                        </div>
                        <h4 class="font-medium">支付宝</h4>
                    </div>
                    
                    <div class="payment-option bg-dark rounded-xl p-4 border border-white/10 cursor-pointer text-center hover:border-primary transition-colors" data-type="wechat">
                        <div class="w-12 h-12 rounded-lg bg-primary/20 flex items-center justify-center text-primary mx-auto mb-3">
                            <i class="fa fa-credit-card text-xl"></i>
                        </div>
                        <h4 class="font-medium">微信支付</h4>
                    </div>
                </div>
                
                <!-- 银行卡表单 -->
                <div id="bank-form" class="space-y-4">
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="bank-name">
                            银行名称
                        </label>
                        <select id="bank-name" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                            <option value="">请选择银行</option>
                            <option value="icbc">中国工商银行</option>
                            <option value="abc">中国农业银行</option>
                            <option value="boc">中国银行</option>
                            <option value="ccb">中国建设银行</option>
                            <option value="cmb">招商银行</option>
                            <option value="cmbc">中国民生银行</option>
                            <option value="cib">兴业银行</option>
                            <option value="spdb">上海浦东发展银行</option>
                            <option value="psbc">中国邮政储蓄银行</option>
                        </select>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="bank-branch">
                            开户支行
                        </label>
                        <input type="text" id="bank-branch" placeholder="请输入开户支行名称" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="bank-account">
                            银行卡号
                        </label>
                        <input type="text" id="bank-account" placeholder="请输入银行卡号" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="bank-holder">
                            账户持有人
                        </label>
                        <input type="text" id="bank-holder" placeholder="请输入账户持有人姓名" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                </div>
                
                <!-- 支付宝表单 -->
                <div id="alipay-form" class="space-y-4" style="display: none;">
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="alipay-account">
                            支付宝账号
                        </label>
                        <input type="text" id="alipay-account" placeholder="请输入支付宝账号" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="alipay-holder">
                            账户持有人
                        </label>
                        <input type="text" id="alipay-holder" placeholder="请输入支付宝账户持有人姓名" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                </div>
                
                <!-- 微信表单 -->
                <div id="wechat-form" class="space-y-4" style="display: none;">
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="wechat-nickname">
                            微信昵称
                        </label>
                        <input type="text" id="wechat-nickname" placeholder="请输入微信昵称" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white">
                    </div>
                </div>
                
                <div class="flex flex-col sm:flex-row gap-4 mt-8">
                    <button type="button" id="cancel-payment" class="w-full sm:w-auto px-6 py-3 bg-dark rounded-lg border border-white/10 text-white hover:bg-white/10 transition-colors font-medium flex items-center justify-center gap-2">
                        取消
                    </button>
                    <button type="submit" class="w-full sm:w-auto px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                        保存
                    </button>
                </div>
            </form>
        </div>
    </div>

    <!-- 确认删除模态框 -->
    <div id="confirm-modal" class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center hidden">
        <div class="bg-dark-blue rounded-2xl p-6 border border-white/10 w-full max-w-md mx-4">
            <h3 class="text-xl font-bold mb-4">确认删除</h3>
            <p class="text-white/70 mb-6">您确定要删除该收款方式吗？删除后将无法恢复。</p>
            
            <div class="flex flex-col sm:flex-row gap-4">
                <button id="cancel-delete" class="w-full sm:w-auto px-6 py-3 bg-dark rounded-lg border border-white/10 text-white hover:bg-white/10 transition-colors font-medium flex items-center justify-center gap-2">
                    取消
                </button>
                <button id="confirm-delete" class="w-full sm:w-auto px-6 py-3 bg-danger text-white rounded-lg hover:bg-danger/90 transition-colors font-medium flex items-center justify-center gap-2">
                    确认删除
                </button>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="bg-dark-blue border-t border-white/10">
        <div class="container mx-auto px-4 py-12">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                            <i class="fa fa-exchange text-white text-xl"></i>
                        </div>
                        <h2 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h2>
                    </div>
                    <p class="text-white/60 mb-4">安全、便捷的USDT交易平台，支持多种本币出售，平台担保交易，保障资金安全</p>
                    <div class="flex space-x-4">
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-twitter"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-telegram"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-discord"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-github"></i>
                        </a>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">出售服务</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">USDT出售流程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">设置出售价格</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">添加收款方式</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">认证卖家权益</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">提现到银行卡</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">资源中心</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">新手教程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">安全指南</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">交易规则</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">联系客服</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">法律合规</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">服务条款</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">风险提示</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">合规声明</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">知识产权</a></li>
                    </ul>
                </div>
            </div>
            
            <div class="h-px bg-white/10 my-8"></div>
            
            <div class="flex flex-col md:flex-row justify-between items-center">
                <p class="text-white/60 text-sm mb-4 md:mb-0">© 2025 USDTMarket. 保留所有权利。平台不参与任何资金交易，仅提供信息匹配服务。</p>
                <div class="flex space-x-6">
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">隐私政策</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">服务条款</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">风险提示</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 导航栏滚动效果
        const navbar = document.getElementById('navbar');
        window.addEventListener('scroll', () => {
            if (window.scrollY > 10) {
                navbar.classList.add('bg-dark-blue/90');
                navbar.classList.add('shadow-lg');
            } else {
                navbar.classList.remove('bg-dark-blue/90');
                navbar.classList.remove('shadow-lg');
            }
        });
        
        // 模态框相关
        const paymentModal = document.getElementById('payment-modal');
        const confirmModal = document.getElementById('confirm-modal');
        const addPaymentBtn = document.getElementById('add-payment-method');
        const closeModalBtn = document.getElementById('close-modal');
        const cancelPaymentBtn = document.getElementById('cancel-payment');
        const cancelDeleteBtn = document.getElementById('cancel-delete');
        const confirmDeleteBtn = document.getElementById('confirm-delete');
        const paymentForm = document.getElementById('payment-form');
        const modalTitle = document.getElementById('modal-title');
        
        let currentPaymentType = 'bank';
        let currentPaymentId = null;
        
        // 打开添加收款方式模态框
        addPaymentBtn.addEventListener('click', () => {
            modalTitle.textContent = '添加收款方式';
            currentPaymentId = null;
            showPaymentModal('bank');
        });
        
        // 关闭模态框
        closeModalBtn.addEventListener('click', () => {
            paymentModal.classList.add('hidden');
        });
        
        cancelPaymentBtn.addEventListener('click', () => {
            paymentModal.classList.add('hidden');
        });
        
        cancelDeleteBtn.addEventListener('click', () => {
            confirmModal.classList.add('hidden');
        });
        
        // 支付方式选择
        document.querySelectorAll('.payment-option').forEach(option => {
            option.addEventListener('click', () => {
                document.querySelectorAll('.payment-option').forEach(opt => {
                    opt.classList.remove('active');
                    opt.classList.remove('border-primary');
                    opt.classList.add('border-white/10');
                });
                
                option.classList.add('active');
                option.classList.remove('border-white/10');
                option.classList.add('border-primary');
                
                currentPaymentType = option.getAttribute('data-type');
                showPaymentForm(currentPaymentType);
            });
        });
        
        // 显示支付表单
        function showPaymentForm(type) {
            document.getElementById('bank-form').style.display = 'none';
            document.getElementById('alipay-form').style.display = 'none';
            document.getElementById('wechat-form').style.display = 'none';
            
            document.getElementById(`${type}-form`).style.display = 'block';
        }
        
        // 显示支付模态框
        function showPaymentModal(type) {
            // 重置表单
            paymentForm.reset();
            
            // 选中对应的支付方式
            document.querySelectorAll('.payment-option').forEach(opt => {
                opt.classList.remove('active');
                opt.classList.remove('border-primary');
                opt.classList.add('border-white/10');
            });
            
            const selectedOption = document.querySelector(`.payment-option[data-type="${type}"]`);
            if (selectedOption) {
                selectedOption.classList.add('active');
                selectedOption.classList.remove('border-white/10');
                selectedOption.classList.add('border-primary');
            }
            
            // 显示对应的表单
            showPaymentForm(type);
            
            // 显示模态框
            paymentModal.classList.remove('hidden');
        }
        
        // 编辑收款方式
        function editPaymentMethod(id) {
            modalTitle.textContent = '编辑收款方式';
            currentPaymentId = id;
            
            // 根据ID设置表单内容（实际项目中从API获取数据）
            if (id === 'bank') {
                showPaymentModal('bank');
                document.getElementById('bank-name').value = 'icbc';
                document.getElementById('bank-branch').value = '北京市朝阳区支行';
                document.getElementById('bank-account').value = '6222 0202 0000 8888 888';
                document.getElementById('bank-holder').value = '张三';
            } else if (id === 'alipay') {
                showPaymentModal('alipay');
                document.getElementById('alipay-account').value = '138****8888';
                document.getElementById('alipay-holder').value = '张三';
            } else if (id === 'wechat') {
                showPaymentModal('wechat');
                document.getElementById('wechat-nickname').value = '张三';
            }
        }
        
        // 删除收款方式
        function deletePaymentMethod(id) {
            currentPaymentId = id;
            confirmModal.classList.remove('hidden');
        }
        
        // 设置默认收款方式
        function setDefaultPayment(id) {
            // 移除所有默认标记
            document.querySelectorAll('.payment-card .absolute.top-4.right-4').forEach(el => {
                el.remove();
            });
            
            // 移除所有默认按钮
            document.querySelectorAll('.payment-card button:text("设置为默认收款方式")').forEach(btn => {
                btn.style.display = 'block';
            });
            
            // 设置新的默认
            const card = document.querySelector(`.payment-card:has(button[onclick="setDefaultPayment('${id}')"])`);
            if (card) {
                // 添加默认标记
                const defaultBadge = document.createElement('div');
                defaultBadge.className = 'absolute top-4 right-4 bg-primary/20 text-primary text-xs px-2 py-1 rounded-full';
                defaultBadge.textContent = '默认';
                card.insertBefore(defaultBadge, card.firstChild);
                
                // 隐藏默认按钮
                const defaultBtn = card.querySelector(`button[onclick="setDefaultPayment('${id}')"]`);
                if (defaultBtn) {
                    defaultBtn.style.display = 'none';
                }
            }
            
            // 显示成功提示（实际项目中可以使用更友好的提示组件）
            alert('已成功设置默认收款方式');
        }
        
        // 确认删除
        confirmDeleteBtn.addEventListener('click', () => {
            if (currentPaymentId) {
                // 移除对应的支付方式卡片
                const card = document.querySelector(`.payment-card:has(button[onclick="deletePaymentMethod('${currentPaymentId}')"])`);
                if (card) {
                    card.remove();
                }
                
                confirmModal.classList.add('hidden');
                alert('收款方式已成功删除');
            }
        });
        
        // 提交表单
        paymentForm.addEventListener('submit', (e) => {
            e.preventDefault();
            
            // 处理表单提交（实际项目中发送到API）
            if (currentPaymentId) {
                // 更新现有收款方式
                alert('收款方式已成功更新');
            } else {
                // 添加新收款方式
                alert('收款方式已成功添加');
            }
            
            paymentModal.classList.add('hidden');
        });
    </script>
</body>
</html>    